' Written by Craig'n'Dave
Module Module1
    ' Linear search
    Sub linear_search(items() As String, item_to_find As String)
        Dim index As Integer = 0
        Dim found As Boolean = False
        ' Check every item until found or until there are no more items to check
        Do While found = False And index < items.Count
            If items(index) = item_to_find Then
                found = True
            Else
                index = index + 1
            End If
        Loop
        If found = True Then
            Console.WriteLine("Item found at position " & index)
        Else
            Console.WriteLine("Item not found")
        End If
    End Sub

    Sub Main()
        ' Main program starts here
        Dim items() As String = {"Florida", "California", "Delaware", "Alabama", "Georgia"}
        Console.Write("Enter the state to find: ")
        Dim item_to_find As String = Console.ReadLine()
        linear_search(items, item_to_find)
    End Sub
End Module
